package sakila.sakilaexcetion;

public class SakilaException extends Exception
{

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -3237562752915108710L;

	/**
	 * Handle exception.
	 * 
	 * @param errMsg the error message
	 * @param e the exception
	 * @return the SakilaException
	 * @throws SakilaException
	 */
	public static SakilaException handleException(String errMsg, Exception e)
	        throws SakilaException
	{
		SakilaLogs.errorLogs(errMsg, e);
		throw new SakilaException(errMsg);
	}

	/**
	 * Instantiates a new sakila exception.
	 */
	public SakilaException()
	{

	}

	/**
	 * Instantiates a new SakilaException.
	 * 
	 * @param msg the error messages
	 */
	public SakilaException(String msg)
	{
		super(msg);
	}

	/**
	 * Instantiates a new sakila exception.
	 * 
	 * @param msg the msg
	 * @param throwable the throwable
	 */
	public SakilaException(String msg, Throwable throwable)
	{
		super((msg == null ? "" : msg) + " " + throwable.getMessage(), throwable);
	}

	/**
	 * Instantiates a new sakila exception.
	 * 
	 * @param throwable the throwable
	 */
	public SakilaException(Throwable throwable)
	{
		super(throwable);
	}

}
